import type { ListResponse } from '@/http';
import { request } from '@/http';
import type { IEventListItem } from './interfaces/events';

/**
 * 存在餐饮活动的日期 —— 三个月内有活动的日期
 */
export function getEventDates(): Promise<ListResponse<string>> {
  return request.post<ListResponse<string>>('/food/activity/getDateList');
}

/**
 * 活动列表
 */
export function getEvents(payload: {
  pagination: boolean;
  page?: number;
  pageSize?: number;
  searchDate?: string;
}): Promise<ListResponse<IEventListItem>> {
  return request.post<ListResponse<IEventListItem>>('/food/activity/getList', payload);
}
